﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VIP_Shop
{
    public partial class frm_Main : Form
    {
        public frm_Main()
        {
            InitializeComponent();
        }
        Boolean flag = true;
          
        private void danhMụcHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm is VIP_Shop.GUI.CapNhap)
                {
                    flag = false;
                    frm.Activate();
                    break;
                }
            }
            if (flag)
            {
                VIP_Shop.GUI.CapNhap frm = new GUI.CapNhap();
                frm.MdiParent = this;
                frm.Show();
            }
            flag = true;

        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void trợGiúpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Mọi Thông Tin Liên Hệ Huỳnh Xuân Huy. Phone: 01695.989.649", "Trợ Giúp", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        private void timTheoTenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm is VIP_Shop.GUI.TimTheoTen)
                {
                    flag = false;
                    frm.Activate();
                    break;
                }
            }
            if (flag)
            {
                VIP_Shop.GUI.TimTheoTen frm = new GUI.TimTheoTen();
                frm.MdiParent = this;
                frm.Show();
            }
            flag = true;
        }

        private void timTheoLoaiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm is VIP_Shop.GUI.TimTheoLoai)
                {
                    flag = false;
                    frm.Activate();
                    break;
                }
            }
            if (flag)
            {
                VIP_Shop.GUI.TimTheoLoai frm = new GUI.TimTheoLoai();
                frm.MdiParent = this;
                frm.Show();
            }
            flag = true;
        }

        private void đăngNhậpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GUI.DangNhap dn = new GUI.DangNhap();
            dn.Visible = true;
            this.Visible = false;
        }

        

        private void thoátToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            GUI.DangNhap dn = new GUI.DangNhap();
            dn.Visible = true;
            this.Visible = false;
        }

        private void kháchHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm is VIP_Shop.GUI.ThongTinKH)
                {
                    flag = false;
                    frm.Activate();
                    break;
                }
            }
            if (flag)
            {
                VIP_Shop.GUI.ThongTinKH frm = new GUI.ThongTinKH();
                frm.MdiParent = this;
                frm.Show();
            }
            flag = true;
        }

        private void chiTietHoaDonToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            foreach (Form frm in this.MdiChildren)
            {
                if (frm is VIP_Shop.GUI.CTHoaDon)
                {
                    flag = false;
                    frm.Activate();
                    break;
                }
            }
            if (flag)
            {
                VIP_Shop.GUI.CTHoaDon frm = new GUI.CTHoaDon();
                frm.MdiParent = this;
                frm.Show();
            }
            flag = true;
        }

        private void lưuTựĐộngBảngToolStripMenuItem_Click(object sender, EventArgs e)
        {

            foreach (Form frm in this.MdiChildren)
            {
                if (frm is VIP_Shop.LoadGRV)
                {
                    flag = false;
                    frm.Activate();
                    break;
                }
            }
            if (flag)
            {
                VIP_Shop.LoadGRV frm = new VIP_Shop.LoadGRV();
                frm.MdiParent = this;
                frm.Show();
            }
            flag = true;
        }

        

  
     }
}
